package cn.edu.ctbu.demo1.service;
import cn.edu.ctbu.demo1.domain.Teacher;
import cn.edu.ctbu.demo1.domain.Teacher;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public interface TeacherService {
    List<Teacher> findAll();

    /**
     * 只支持分页的查询
     * @param pageable
     * @return
     */
    Page<Teacher> findAll(Pageable pageable);

    /**
     *
     * @param
     * @return
     */
    public Page<Teacher> findAll(Example<Teacher> teacher,Pageable pageable);
    List<Teacher> findAll(Example<Teacher> example);
    /**
     *按id进行查询
     * @param id 主键，整数
     * @return
     */
    Teacher findById(Integer id);

    /**
     *按姓名进行查询 ,like
     * @param name 主键，整数
     * @return
     */
    List<Teacher> findByName(String name);
    //    /**
//     *按姓名和密码进行查询 ,like
//     * @param name
//     * @param password
//     * @return
//     */
//     Teacher findByNameAndPassword(String name,String password);
    List<Teacher> findByNameAndPassword(String name,String password);
    List<Teacher> findByNoAndPassword(String no,String password);
//    Teacher findByNameAndPassword(String name,String password) throws Exception;

    Teacher insert(Teacher teacher);
    Teacher update(Teacher teacher);

    void delete(Integer id);

}
